<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('线体监控')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row col-sm-12">
            <div id="div2" style="height: 30%;width: 98%" class="col-sm-5 select-table">
                <h3>入库口</h3>
                <table id="bootstrap-table2"></table>
            </div>
            <div class="row col-sm-12" style="height: 70%;width: 49%;top :1%">
                <div id="div1" style="height: 55%;width: 100%" class="col-sm-5 select-table">
                    <h3>拣选口</h3>
                    <table id="bootstrap-table1"></table>
                </div>
                <div id="div3" style="height: 40%;width: 100%; top:1%" class="col-sm-5 select-table">
                    <h3>提升机对接口</h3>
                    <table id="bootstrap-table3"></table>
                </div>
            </div>
            <div id="div4" style="height: 68%;width: 49%; left:2%; top: 1%" class="col-sm-5 select-table">
                <h3>料箱补给口</h3>
                <table id="bootstrap-table4"></table>
            </div>
        </div>

    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<script th:inline="javascript">
    // var editFlag = [[${@permission.hasPermi('msgLxkSsj:lxk:edit')}]];
    // var removeFlag = [[${@permission.hasPermi('msgLxkSsj:lxk:remove')}]];
    var prefix = ctx + "msgLxkSsj/lxk";

    $(function () {
        var panehHidden = false;
        if ($(this).width() < 769) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 85});
        // 回到顶部绑定
        if ($.fn.toTop !== undefined) {
            var opt = {
                win: $('.ui-layout-center'),
                doc: $('.ui-layout-center')
            };
            $('#scroll-up').toTop(opt);
        }

        queryUserList1();
        queryUserList2();
        queryUserList3();
        queryUserList4();
        // queryUserList5();
        // queryUserList6();

        reloadTable();


    });

    function reloadTable() {

        $('#bootstrap-table1').bootstrapTable('refresh');
        $('#bootstrap-table2').bootstrapTable('refresh');
        $('#bootstrap-table3').bootstrapTable('refresh');
        // $('#bootstrap-table4').bootstrapTable('refresh');
        // $('#bootstrap-table5').bootstrapTable('refresh');
        // $('#bootstrap-table6').bootstrapTable('refresh');

        setTimeout(reloadTable, 3 * 1000);
    }

    function queryUserList1() {

        var options1 = {
            url: prefix + "/list?location=6",
            height: $("#div1").height() / 1.3,
            modalName: "id",
            columns: [

                {
                    field: 'id',
                    title: '设备编号 ',
                    align: 'center',
                },
                // {
                //     field: 'location',
                //     title: '',
                //     sortable: true
                // },
                {
                    field: 'name',
                    title: '设备名称 ',
                    align: 'center',
                },
                {
                    field: 'rwh',
                    title: '任务号 ',
                    align: 'center',
                },
                {
                    field: 'dw',
                    title: '到位信号',
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "入库到位";
                        } else if (value == 2) {
                            return "出库到位";
                        }else {
                            return "未到位";
                        }
                    }
                },
                {
                    field: 'kx',
                    title: '空闲信号 ',
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "空闲";
                        } else {
                            return "未空闲";
                        }
                    }
                },

                {
                    field: 'rkqq',
                    title: '入库请求',
                    sortable: true,
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "有请求";
                        } else {
                            return "无请求";
                        }
                    }
                }
            ]
        };
        $('#bootstrap-table1').bootstrapTable(options1)
    }

    function queryUserList2() {

        var options1 = {
            url: prefix + "/list?location=1",
            height: $("#div2").height() / 1.3,
            modalName: "RGV",
            columns: [

                {
                    field: 'id',
                    title: '设备编号 ',
                    align: 'center',
                },
                // {
                //     field: 'location',
                //     title: '',
                //     sortable: true
                // },
                {
                    field: 'name',
                    title: '设备名称 ',
                    align: 'center',
                },
                {
                    field: 'rwh',
                    title: '任务号 ',
                    align: 'center',
                },
                {
                    field: 'dw',
                    title: '到位信号',
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "入库到位";
                        } else if (value == 2) {
                            return "出库到位";
                        }else {
                            return "未到位";
                        }
                    }
                },
                {
                    field: 'kx',
                    title: '空闲信号 ',
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "空闲";
                        } else {
                            return "未空闲";
                        }
                    }
                },

                {
                    field: 'rkqq',
                    title: '入库请求',
                    sortable: true,
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "有请求";
                        } else {
                            return "无请求";
                        }
                    }
                }
            ]
        };
        $('#bootstrap-table2').bootstrapTable(options1)
    }

    function queryUserList3() {

        var options1 = {
            url: prefix + "/list?location=2",
            height: $("#div3").height() / 1.3,
            modalName: "RGV",
            columns: [

                {
                    field: 'id',
                    title: '设备编号 ',
                    align: 'center',
                },
                // {
                //     field: 'location',
                //     title: '',
                //     sortable: true
                // },
                {
                    field: 'name',
                    title: '设备名称 ',
                    align: 'center',
                },
                {
                    field: 'rwh',
                    title: '任务号 ',
                    align: 'center',
                },
                {
                    field: 'dw',
                    title: '到位信号',
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "入库到位";
                        } else if (value == 2) {
                            return "出库到位";
                        }else {
                            return "未到位";
                        }
                    }
                },
                {
                    field: 'kx',
                    title: '空闲信号 ',
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "空闲";
                        } else {
                            return "未空闲";
                        }
                    }
                },

                {
                    field: 'rkqq',
                    title: '入库请求',
                    sortable: true,
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "有请求";
                        } else {
                            return "无请求";
                        }
                    }
                }
            ]
        };
        $('#bootstrap-table3').bootstrapTable(options1)
    }

    function queryUserList4() {

        var options1 = {
            url: prefix + "/list?location=5",
            height: $("#div4").height() / 1.1,
            modalName: "RGV",
            columns: [

                {
                    field: 'id',
                    title: '设备编号 ',
                    align: 'center',
                },
                // {
                //     field: 'location',
                //     title: '',
                //     sortable: true
                // },
                {
                    field: 'name',
                    title: '设备名称 ',
                    align: 'center',
                },
                {
                    field: 'rwh',
                    title: '任务号 ',
                    align: 'center',
                },
                {
                    field: 'dw',
                    title: '到位信号',
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "入库到位";
                        } else if (value == 2) {
                            return "出库到位";
                        }else {
                            return "未到位";
                        }
                    }
                },
                {
                    field: 'kx',
                    title: '空闲信号 ',
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "空闲";
                        } else {
                            return "未空闲";
                        }
                    }
                },

                {
                    field: 'rkqq',
                    title: '入库请求',
                    sortable: true,
                    align: 'center',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "有请求";
                        } else {
                            return "无请求";
                        }
                    }
                }
            ]
        };
        $('#bootstrap-table4').bootstrapTable(options1)
    }

    function queryUserList5() {

        var options1 = {
            url: prefix + "/list?location=5",
            height: $("#div4").height() / 1.1,
            modalName: "RGV",
            columns: [

                {
                    field: 'name',
                    title: '设备编号 '
                },
                {
                    field: 'rwh',
                    title: '任务号',
                    sortable: true
                },

                {
                    field: 'roadway_id',
                    title: '所属巷道',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "1巷道";
                        } else if (value == 2) {
                            return "2巷道";
                        } else if (value == 3) {
                            return "3巷道";
                        }
                    }
                },
                {
                    field: 'in_or_out',
                    title: '类型',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "入库输送机";
                        } else if (value == 2) {
                            return "出库输送机";
                        }
                    }
                },
                {
                    field: 'rkdw',
                    title: '到位',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "入库到位";
                        } else if (value == 2) {
                            return "出库到位";
                        }else {
                            return "未到位";
                        }
                    }
                },
                {
                    field: 'ckkx',
                    title: '空闲',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "空闲";
                        } else {
                            return "未空闲";
                        }
                    }
                }
            ]
        };
        $('#bootstrap-table5').bootstrapTable(options1)
    }

    function queryUserList6() {

        var options1 = {
            url: prefix + "/list?location=6",
            height: $("#div4").height() / 1.1,
            modalName: "RGV",
            columns: [

                {
                    field: 'name',
                    title: '设备编号 '
                },
                {
                    field: 'rwh',
                    title: '任务号',
                    sortable: true
                },

                {
                    field: 'roadway_id',
                    title: '所属巷道',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "1巷道";
                        } else if (value == 2) {
                            return "2巷道";
                        } else if (value == 3) {
                            return "3巷道";
                        }
                    }
                },
                {
                    field: 'in_or_out',
                    title: '类型',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "入库输送机";
                        } else if (value == 2) {
                            return "出库输送机";
                        }
                    }
                },
                {
                    field: 'rkdw',
                    title: '到位',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "入库到位";
                        } else if (value == 2) {
                            return "出库到位";
                        }else {
                            return "未到位";
                        }
                    }
                },
                {
                    field: 'ckkx',
                    title: '空闲',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "空闲";
                        } else {
                            return "未空闲";
                        }
                    }
                }
            ]
        };
        $('#bootstrap-table6').bootstrapTable(options1)
    }


</script>
</body>
</html>